/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/idenger">idenger</a> All rights reserved.
 */
package com.idenger.modules.edu.service.shopping;

import java.util.List;

import com.idenger.modules.edu.dao.shopping.EduShoppingCartDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.idenger.common.persistence.Page;
import com.idenger.common.service.CrudService;
import com.idenger.modules.edu.entity.shopping.EduShoppingCart;
import com.idenger.modules.edu.entity.shopping.ShoppingCart;

/**
 * 购物车Service
 * @author chenlin
 * @version 2017-12-14
 */
@Service
@Transactional(readOnly = true)
public class EduShoppingCartService extends CrudService<EduShoppingCartDao, EduShoppingCart> {

	public EduShoppingCart get(String id) {
		return super.get(id);
	}

	public List<EduShoppingCart>  forbidSameDataToCart(EduShoppingCart eduShoppingCart){
		return dao.forbidSameDataToCart(eduShoppingCart);
	}
	
	public List<ShoppingCart> findShoppingCart(String userId){
		return dao.findShoppingCart(userId);
	}

	public List<EduShoppingCart> 	findShoppCartProject(EduShoppingCart eduShoppingCart){
		return dao.findShoppCartProject(eduShoppingCart);
	}
	
	@Transactional(readOnly = false)
	public void deleteShoppoCart(String userId,String courseId){
		dao.deleteShopping(userId, courseId);
	}
	
	public List<EduShoppingCart>   findListByUserIdAndProjectId(EduShoppingCart eduShoppingCart){
		return dao.findListByUserIdAndProjectId(eduShoppingCart);
	}

	public List<EduShoppingCart> findList(EduShoppingCart eduShoppingCart) {
		return super.findList(eduShoppingCart);
	}
	
	public Page<EduShoppingCart> findPage(Page<EduShoppingCart> page, EduShoppingCart eduShoppingCart) {
		return super.findPage(page, eduShoppingCart);
	}
	
	@Transactional(readOnly = false)
	public void save(EduShoppingCart eduShoppingCart) {
		super.save(eduShoppingCart);
	}
	
	@Transactional(readOnly = false)
	public void delete(EduShoppingCart eduShoppingCart) {
		super.delete(eduShoppingCart);
	}
	
}